
_MOTORS_update:

;motors.c,11 :: 		void MOTORS_update(unsigned short *MOTORS_speed) {
;motors.c,15 :: 		MOTORS_biggest_speed = 0;
	CLRF        R2 
;motors.c,17 :: 		for(cnt=0; cnt<4; cnt++) {
	CLRF        R1 
L_MOTORS_update0:
	MOVLW       4
	SUBWF       R1, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_MOTORS_update1
;motors.c,18 :: 		if(MOTORS_speed[cnt] > MOTORS_max_speed) MOTORS_speed[cnt] = MOTORS_max_speed;
	MOVF        R1, 0 
	ADDWF       FARG_MOTORS_update_MOTORS_speed+0, 0 
	MOVWF       FSR0L 
	MOVLW       0
	ADDWFC      FARG_MOTORS_update_MOTORS_speed+1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	SUBLW       250
	BTFSC       STATUS+0, 0 
	GOTO        L_MOTORS_update3
	MOVF        R1, 0 
	ADDWF       FARG_MOTORS_update_MOTORS_speed+0, 0 
	MOVWF       FSR1L 
	MOVLW       0
	ADDWFC      FARG_MOTORS_update_MOTORS_speed+1, 0 
	MOVWF       FSR1H 
	MOVLW       250
	MOVWF       POSTINC1+0 
L_MOTORS_update3:
;motors.c,19 :: 		MOTORS_biggest_speed = (MOTORS_speed[cnt] >= MOTORS_biggest_speed) ? MOTORS_speed[cnt] : MOTORS_biggest_speed;
	MOVF        R1, 0 
	ADDWF       FARG_MOTORS_update_MOTORS_speed+0, 0 
	MOVWF       FSR0L 
	MOVLW       0
	ADDWFC      FARG_MOTORS_update_MOTORS_speed+1, 0 
	MOVWF       FSR0H 
	MOVF        R2, 0 
	SUBWF       POSTINC0+0, 0 
	BTFSS       STATUS+0, 0 
	GOTO        L_MOTORS_update4
	MOVF        R1, 0 
	ADDWF       FARG_MOTORS_update_MOTORS_speed+0, 0 
	MOVWF       FSR0L 
	MOVLW       0
	ADDWFC      FARG_MOTORS_update_MOTORS_speed+1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       R0 
	GOTO        L_MOTORS_update5
L_MOTORS_update4:
	MOVF        R2, 0 
	MOVWF       R0 
L_MOTORS_update5:
	MOVF        R0, 0 
	MOVWF       R2 
;motors.c,17 :: 		for(cnt=0; cnt<4; cnt++) {
	INCF        R1, 1 
;motors.c,20 :: 		}
	GOTO        L_MOTORS_update0
L_MOTORS_update1:
;motors.c,22 :: 		for(cnt=0; cnt<=MOTORS_biggest_speed; cnt++) {
	CLRF        R1 
L_MOTORS_update6:
	MOVF        R1, 0 
	SUBWF       R2, 0 
	BTFSS       STATUS+0, 0 
	GOTO        L_MOTORS_update7
;motors.c,24 :: 		if(cnt == MOTORS_speed[0]) MOTORS_M1 = 1;
	MOVFF       FARG_MOTORS_update_MOTORS_speed+0, FSR2L
	MOVFF       FARG_MOTORS_update_MOTORS_speed+1, FSR2H
	MOVF        R1, 0 
	XORWF       POSTINC2+0, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L_MOTORS_update9
	BSF         PORTC+0, 0 
L_MOTORS_update9:
;motors.c,25 :: 		if(cnt == MOTORS_speed[1]) MOTORS_M2 = 1;
	MOVLW       1
	ADDWF       FARG_MOTORS_update_MOTORS_speed+0, 0 
	MOVWF       FSR2L 
	MOVLW       0
	ADDWFC      FARG_MOTORS_update_MOTORS_speed+1, 0 
	MOVWF       FSR2H 
	MOVF        R1, 0 
	XORWF       POSTINC2+0, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L_MOTORS_update10
	BSF         PORTC+0, 1 
L_MOTORS_update10:
;motors.c,26 :: 		if(cnt == MOTORS_speed[2]) MOTORS_M3 = 1;
	MOVLW       2
	ADDWF       FARG_MOTORS_update_MOTORS_speed+0, 0 
	MOVWF       FSR2L 
	MOVLW       0
	ADDWFC      FARG_MOTORS_update_MOTORS_speed+1, 0 
	MOVWF       FSR2H 
	MOVF        R1, 0 
	XORWF       POSTINC2+0, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L_MOTORS_update11
	BSF         PORTC+0, 6 
L_MOTORS_update11:
;motors.c,27 :: 		if(cnt == MOTORS_speed[3]) MOTORS_MS = 1;
	MOVLW       3
	ADDWF       FARG_MOTORS_update_MOTORS_speed+0, 0 
	MOVWF       FSR2L 
	MOVLW       0
	ADDWFC      FARG_MOTORS_update_MOTORS_speed+1, 0 
	MOVWF       FSR2H 
	MOVF        R1, 0 
	XORWF       POSTINC2+0, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L_MOTORS_update12
	BSF         PORTC+0, 7 
L_MOTORS_update12:
;motors.c,29 :: 		Delay_us(2);
	MOVLW       7
	MOVWF       R13, 0
L_MOTORS_update13:
	DECFSZ      R13, 1, 1
	BRA         L_MOTORS_update13
	NOP
	NOP
;motors.c,22 :: 		for(cnt=0; cnt<=MOTORS_biggest_speed; cnt++) {
	INCF        R1, 1 
;motors.c,30 :: 		}
	GOTO        L_MOTORS_update6
L_MOTORS_update7:
;motors.c,31 :: 		}
	RETURN      0
; end of _MOTORS_update

_MOTORS_esc_startup:

;motors.c,36 :: 		void MOTORS_esc_startup() {
;motors.c,37 :: 		unsigned short cnt=0;
	CLRF        MOTORS_esc_startup_cnt_L0+0 
;motors.c,38 :: 		while(cnt<100) {
L_MOTORS_esc_startup14:
	MOVLW       100
	SUBWF       MOTORS_esc_startup_cnt_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_MOTORS_esc_startup15
;motors.c,39 :: 		MOTORS_M1 = 0;
	BCF         PORTC+0, 0 
;motors.c,40 :: 		MOTORS_M2 = 0;
	BCF         PORTC+0, 1 
;motors.c,41 :: 		MOTORS_M3 = 0;
	BCF         PORTC+0, 6 
;motors.c,42 :: 		MOTORS_MS = 0;
	BCF         PORTC+0, 7 
;motors.c,43 :: 		Delay_ms(1);
	MOVLW       16
	MOVWF       R12, 0
	MOVLW       148
	MOVWF       R13, 0
L_MOTORS_esc_startup16:
	DECFSZ      R13, 1, 1
	BRA         L_MOTORS_esc_startup16
	DECFSZ      R12, 1, 1
	BRA         L_MOTORS_esc_startup16
	NOP
;motors.c,44 :: 		MOTORS_M1 = 1;
	BSF         PORTC+0, 0 
;motors.c,45 :: 		MOTORS_M2 = 1;
	BSF         PORTC+0, 1 
;motors.c,46 :: 		MOTORS_M3 = 1;
	BSF         PORTC+0, 6 
;motors.c,47 :: 		MOTORS_MS = 1;
	BSF         PORTC+0, 7 
;motors.c,48 :: 		Delay_ms(20);
	MOVLW       2
	MOVWF       R11, 0
	MOVLW       56
	MOVWF       R12, 0
	MOVLW       173
	MOVWF       R13, 0
L_MOTORS_esc_startup17:
	DECFSZ      R13, 1, 1
	BRA         L_MOTORS_esc_startup17
	DECFSZ      R12, 1, 1
	BRA         L_MOTORS_esc_startup17
	DECFSZ      R11, 1, 1
	BRA         L_MOTORS_esc_startup17
;motors.c,49 :: 		cnt++;
	INCF        MOTORS_esc_startup_cnt_L0+0, 1 
;motors.c,50 :: 		}
	GOTO        L_MOTORS_esc_startup14
L_MOTORS_esc_startup15:
;motors.c,51 :: 		}
	RETURN      0
; end of _MOTORS_esc_startup

_MOTORS_esc_config:

;motors.c,60 :: 		void MOTORS_esc_config() {
;motors.c,62 :: 		unsigned short cnt=0;
	CLRF        MOTORS_esc_config_cnt_L0+0 
;motors.c,63 :: 		MOTORS_speed_align[0] = MOTORS_max_speed;
	MOVLW       250
	MOVWF       MOTORS_esc_config_MOTORS_speed_align_L0+0 
;motors.c,64 :: 		MOTORS_speed_align[1] = MOTORS_max_speed;
	MOVLW       250
	MOVWF       MOTORS_esc_config_MOTORS_speed_align_L0+1 
;motors.c,65 :: 		MOTORS_speed_align[2] = MOTORS_max_speed;
	MOVLW       250
	MOVWF       MOTORS_esc_config_MOTORS_speed_align_L0+2 
;motors.c,66 :: 		MOTORS_speed_align[3] = MOTORS_max_speed;
	MOVLW       250
	MOVWF       MOTORS_esc_config_MOTORS_speed_align_L0+3 
;motors.c,67 :: 		while(cnt<100) {
L_MOTORS_esc_config18:
	MOVLW       100
	SUBWF       MOTORS_esc_config_cnt_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_MOTORS_esc_config19
;motors.c,68 :: 		MOTORS_M1 = 0;
	BCF         PORTC+0, 0 
;motors.c,69 :: 		MOTORS_M2 = 0;
	BCF         PORTC+0, 1 
;motors.c,70 :: 		MOTORS_M3 = 0;
	BCF         PORTC+0, 6 
;motors.c,71 :: 		MOTORS_MS = 0;
	BCF         PORTC+0, 7 
;motors.c,72 :: 		Delay_ms(1);
	MOVLW       16
	MOVWF       R12, 0
	MOVLW       148
	MOVWF       R13, 0
L_MOTORS_esc_config20:
	DECFSZ      R13, 1, 1
	BRA         L_MOTORS_esc_config20
	DECFSZ      R12, 1, 1
	BRA         L_MOTORS_esc_config20
	NOP
;motors.c,73 :: 		MOTORS_update(&MOTORS_speed_align);
	MOVLW       MOTORS_esc_config_MOTORS_speed_align_L0+0
	MOVWF       FARG_MOTORS_update_MOTORS_speed+0 
	MOVLW       hi_addr(MOTORS_esc_config_MOTORS_speed_align_L0+0)
	MOVWF       FARG_MOTORS_update_MOTORS_speed+1 
	CALL        _MOTORS_update+0, 0
;motors.c,74 :: 		MOTORS_M1 = 1;
	BSF         PORTC+0, 0 
;motors.c,75 :: 		MOTORS_M2 = 1;
	BSF         PORTC+0, 1 
;motors.c,76 :: 		MOTORS_M3 = 1;
	BSF         PORTC+0, 6 
;motors.c,77 :: 		MOTORS_MS = 1;
	BSF         PORTC+0, 7 
;motors.c,78 :: 		Delay_ms(20);
	MOVLW       2
	MOVWF       R11, 0
	MOVLW       56
	MOVWF       R12, 0
	MOVLW       173
	MOVWF       R13, 0
L_MOTORS_esc_config21:
	DECFSZ      R13, 1, 1
	BRA         L_MOTORS_esc_config21
	DECFSZ      R12, 1, 1
	BRA         L_MOTORS_esc_config21
	DECFSZ      R11, 1, 1
	BRA         L_MOTORS_esc_config21
;motors.c,79 :: 		cnt++;
	INCF        MOTORS_esc_config_cnt_L0+0, 1 
;motors.c,80 :: 		}
	GOTO        L_MOTORS_esc_config18
L_MOTORS_esc_config19:
;motors.c,81 :: 		cnt = 0;
	CLRF        MOTORS_esc_config_cnt_L0+0 
;motors.c,82 :: 		while(cnt<100) {
L_MOTORS_esc_config22:
	MOVLW       100
	SUBWF       MOTORS_esc_config_cnt_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_MOTORS_esc_config23
;motors.c,83 :: 		MOTORS_M1 = 0;
	BCF         PORTC+0, 0 
;motors.c,84 :: 		MOTORS_M2 = 0;
	BCF         PORTC+0, 1 
;motors.c,85 :: 		MOTORS_M3 = 0;
	BCF         PORTC+0, 6 
;motors.c,86 :: 		MOTORS_MS = 0;
	BCF         PORTC+0, 7 
;motors.c,87 :: 		Delay_ms(1);
	MOVLW       16
	MOVWF       R12, 0
	MOVLW       148
	MOVWF       R13, 0
L_MOTORS_esc_config24:
	DECFSZ      R13, 1, 1
	BRA         L_MOTORS_esc_config24
	DECFSZ      R12, 1, 1
	BRA         L_MOTORS_esc_config24
	NOP
;motors.c,88 :: 		MOTORS_M1 = 1;
	BSF         PORTC+0, 0 
;motors.c,89 :: 		MOTORS_M2 = 1;
	BSF         PORTC+0, 1 
;motors.c,90 :: 		MOTORS_M3 = 1;
	BSF         PORTC+0, 6 
;motors.c,91 :: 		MOTORS_MS = 1;
	BSF         PORTC+0, 7 
;motors.c,92 :: 		Delay_ms(20);
	MOVLW       2
	MOVWF       R11, 0
	MOVLW       56
	MOVWF       R12, 0
	MOVLW       173
	MOVWF       R13, 0
L_MOTORS_esc_config25:
	DECFSZ      R13, 1, 1
	BRA         L_MOTORS_esc_config25
	DECFSZ      R12, 1, 1
	BRA         L_MOTORS_esc_config25
	DECFSZ      R11, 1, 1
	BRA         L_MOTORS_esc_config25
;motors.c,93 :: 		cnt++;
	INCF        MOTORS_esc_config_cnt_L0+0, 1 
;motors.c,94 :: 		}
	GOTO        L_MOTORS_esc_config22
L_MOTORS_esc_config23:
;motors.c,95 :: 		Delay_ms(2000);
	MOVLW       122
	MOVWF       R11, 0
	MOVLW       193
	MOVWF       R12, 0
	MOVLW       129
	MOVWF       R13, 0
L_MOTORS_esc_config26:
	DECFSZ      R13, 1, 1
	BRA         L_MOTORS_esc_config26
	DECFSZ      R12, 1, 1
	BRA         L_MOTORS_esc_config26
	DECFSZ      R11, 1, 1
	BRA         L_MOTORS_esc_config26
	NOP
	NOP
;motors.c,96 :: 		}
	RETURN      0
; end of _MOTORS_esc_config
